home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 272_01 / enterfn.doc < prev    next >
Text File  |  1987-07-08  |  2KB  |  56 lines

  1.  
  2.         NAME
  3.                 enterfn -- enter a filename from keyboard
  4.                 disp_enterfn -- same, use direct video access
  5.  
  6.         SYNOPSIS
  7.                 void enterfn(dest, qty, row, col, allow);
  8.                 void disp_enterfn(dest, qty, row, col, allow);
  9.                 char *dest;     destination for string
  10.                 int qty;        maximum allowable chars + 1
  11.                 int row, col;   row and column of string start*
  12.                 int allow;      TRUE to allow entension entry
  13.  
  14.         DESCRIPTION
  15.         These routines are essentially the same, except that
  16.         disp_enterfn uses the Datalite direct video access
  17.         functions.  enterfn() provides a convenient method
  18.         for entering a path and filename from the keyboard and
  19.         verifying the character syntax.  Line editing is
  20.         supported to enhance user input.  Entry is as follows:
  21.            Carriage Return terminates input.
  22.              If no other data was entered, destination string
  23.              is NULLed in the first position. CR is not placed
  24.              into destination.
  25.            ESCape terminates entry at once, NULLs destination,
  26.              and clears screen field.
  27.            HOME clears field, and restarts entry without returning.
  28.            BACKSPACE and Cursor Left will destructively backspace
  29.              up to beginning of field.
  30.            Only qty - 1 characters will be accepted.
  31.            Any error sounds console BELL.
  32.            If "allow" is TRUE, then a filename extension may be
  33.              entered.  Otherwise, no extension may be entered, since
  34.              the period character will be disallowed.
  35.            A drive may be specified; the colon is only allowed in the
  36.              second character string position.
  37.  
  38.  
  39.         EXAMPLE
  40.  
  41.            char string[31];
  42.  
  43.            d_pos(10, 20, 0);      /* cursor to row 10, column 20 */
  44.            fputs("Enter a filename: ", stdout);
  45.            enterfn(string, 31, 10, 38, TRUE));
  46.  
  47.            fputs("Enter filename at current cursor position: ", stdout);
  48.            enterfn(string, 31, -1, 0, FALSE);
  49.  
  50.         * for enterfn only: If row = -1, then current cursor position
  51.           will be used, and col value is ignored.
  52.  
  53.  
  54.  
  55.         This function is found in SMDLx.LIB for the Datalight Compiler.
  56.